﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.SC.DCYY
{
    /// <summary>
    /// ShouShuHuLiJiLuCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class ShuQianShuHouHuLiFangShiCtrl : CustomCommonTableCtrl
    {
        public ShuQianShuHouHuLiFangShiCtrl()
        {
            InitializeComponent();
            if (DataManager.Instance.CurrentPatientLink != null) { 
            sssj.Text = DataManager.Instance.CurrentPatientLink.Status.InRoomTime.Equals(new DateTime())?"":DataManager.Instance.CurrentPatientLink.Status.InRoomTime.ToString(DateFormat.DATE_FORMAT_STR_YMD_CN);
            }
            IniteRadioBation();
        }
        private void sssj_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cuText = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                cuText.Value = cusDatePicker.SelectedDateTime;//2005年11月5日
            }
        }
        private void IniteRadioBation()
        {         
            new RadioButtonHelper().ChangeRadioSatus(stzk_jk, stzk_yb, stzk_xr); new RadioButtonHelper().ChangeRadioSatus(tx__jk, tx__yb, tx_xr);
            new RadioButtonHelper().ChangeRadioSatus(xt_jk, xt_yb, xt_xr); new RadioButtonHelper().ChangeRadioSatus(zt_jk, zt_yb);
            new RadioButtonHelper().ChangeRadioSatus(xg__jk, xg__yb, xg_xr); new RadioButtonHelper().ChangeRadioSatus(js_jiah, js_ch, js_dm);
            new RadioButtonHelper().ChangeRadioSatus(ttd_jiah, ttd_ch); new RadioButtonHelper().ChangeRadioSatus(tw_jiah, tw_ch, tw_dm);
            new RadioButtonHelper().ChangeRadioSatus(pf_jiah, pf_ch); new RadioButtonHelper().ChangeRadioSatus(zpqk_jiah, zpqk_ch, zpqk_dm);
            new RadioButtonHelper().ChangeRadioSatus(sk_jiah, sk_ch); new RadioButtonHelper().ChangeRadioSatus(wcqk_jiah, wcqk_ch, wcqk_dm);
            new RadioButtonHelper().ChangeRadioSatus(pj_jiah, pj_ch, pj_dm); 
            new RadioButtonHelper().ChangeRadioSatus(td_jiah, td_ch); 
            new RadioButtonHelper().ChangeRadioSatus(zt_jiah, zt_ch, zt_dm); 
            new RadioButtonHelper().ChangeRadioSatus(phqk_jiah, phqk_ch, phqk_dm);


        }
        
        private void fsrq_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cuText = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                cuText.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMD_CN);//2005年11月5日
            }
        }
    }
}
